home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINPROGS / PCL4W10.ZIP / PCL4W.USR < prev    next >
Text File  |  1994-02-21  |  85KB  |  2,041 lines

  1.  
  2.  
  3.                               Personal Communications Library
  4.  
  5.                                        For Windows
  6.  
  7.  
  8.                                          (PCL4W)
  9.  
  10.  
  11.  
  12.                                       USERS MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                        Version 1.01
  19.  
  20.                                        Feb 21, 1994
  21.  
  22.  
  23.  
  24.  
  25.                              This software is provided as-is.
  26.                       There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                                    Copyright (C) 1994
  32.                                    All rights reserved
  33.  
  34.  
  35.  
  36.                                    MarshallSoft Computing, Inc.
  37.                                    Post Office Box 4543
  38.                                    Huntsville AL 35815
  39.  
  40.                                    Voice 205-881-4630
  41.                                    FAX   205-881-4630
  42.                                    BBS   205-880-9748
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.              PCL4W Users Manual                                                Page 1
  69.                                    C O N T E N T S
  70.  
  71.  
  72.  
  73.  
  74.  
  75.               Chapter                                                   Page
  76.  
  77.               1.0 Introduction................................................3
  78.                   1.1 User Support............................................4
  79.                   1.2 A Typical Application...................................5
  80.                   1.3 Installation............................................6
  81.               2.0 Library Organization........................................7
  82.                   2.1 Configuration...........................................7
  83.                   2.2 Initialization & Termination............................7
  84.                   2.3 Modem Control & Status..................................8
  85.                   2.4 Serial I/O..............................................8
  86.                   2.5 Error Detection.........................................9
  87.                   2.6 General Support.........................................9
  88.               3.0 Library Overview...........................................10
  89.                   3.1 Dynamic Link Libraries.................................10
  90.                   3.2 DOS Protected Mode Interface...........................10
  91.                   3.3 Memory Models..........................................10
  92.                   3.4 Using the Library......................................10
  93.                   3.5 Example Programs.......................................11
  94.                   3.6 Making the Library.....................................11
  95.               4.0 Talking to Your Modem......................................12
  96.                   4.1 Modem Standards........................................12
  97.                   4.2 Flow Control...........................................13
  98.                   4.3 Modem Initialization...................................14
  99.               5.0 Problems...................................................15
  100.               6.0 Serial Communications......................................16
  101.                   6.1 Communications Basics..................................16
  102.                   6.2 Standard Port Addresses................................17
  103.                   6.3 Running 3 or 4 Ports Concurrently......................18
  104.                   6.4 Using the DigiBoard....................................19
  105.                   6.5 Transmitter Interrupts.................................20
  106.                   6.6 RS232 Signals..........................................21
  107.                   6.7 National INS8250, INS16450, and INS16550 UARTs.........22
  108.                   6.8 Register Summary.......................................23
  109.               7.0 Example Programs...........................................25
  110.                   7.1 SIMPLE.C...............................................25
  111.                   7.2 TERM.C.................................................26
  112.               8.0 Legal Issues...............................................27
  113.                   8.1 Registration...........................................27
  114.                   8.2 License................................................28
  115.                   8.3 Warranty...............................................28
  116.               9.0 Summary....................................................29
  117.                   9.1 Revision History.......................................29
  118.                   9.2 Function Summary.......................................29
  119.                   9.3 Further Reading........................................29
  120.              10.0 Other MarshallSoft Computing products for C................30
  121.                  10.1 The Personal Communications Library for C..............30
  122.                  10.2 The LZW Data Compression Library for C.................30
  123.                  10.3 The EMS Expanded Memory Library for C..................30
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.              PCL4W Users Manual                                                Page 2
  137.               1.0 Introduction
  138.  
  139.  
  140.               The  Personal  Communications Library for Windows (PCL4W) is an asynchronous
  141.               communications dynamic link library (DLL) for software developers using  the
  142.               Microsoft  Windows  7.0  (or  higher)  compiler  and  Windows  3.1  Software
  143.               Development Kit (SDK) or the Borland 3.1  (or  higher)  windows  development
  144.               environment.  A 80386 machine or higher is recommended.
  145.  
  146.  
  147.               o 30+ communications functions.
  148.               o Supports the high performance INS16550 UART.
  149.               o Supports the PC/4 and PC/8 DigiBoard.
  150.               o Supports hardware (RTS/CTS) flow control.
  151.               o Interrupt driven receiver & (optionally) transmitter.
  152.               o Supports 300 baud to 115,200 baud.
  153.               o Supports COM1 through COM4 (through COM10 with DigiBoard).
  154.               o Adjustable queues from 8 bytes to 32 KB.
  155.               o Control-BREAK error exit.
  156.               o 18 communications error conditions trapped.
  157.               o Allows 4 ports to run concurrently (10 with DigiBoard).
  158.               o Complete modem control & status.
  159.               o Written in assembly language for small size & high speed.
  160.               o Terminal program featuring ASCII (with XON/XOFF), XMODEM,
  161.                 YMODEM, & YMODEM-G.
  162.  
  163.  
  164.               Why should you buy PCL4W? Consider the following:
  165.  
  166.                  COMPLETE  -  PCL4W is complete since it provides absolute control of the
  167.                               serial ports (including the high performance INS16550).
  168.  
  169.                   COMPACT  -  PCL4W is very compact at less than 6 KB.  Your  application
  170.                               doesn't carry a lot of excess code.
  171.  
  172.                      FAST  -  PCL4W is fast.  It will run at 115200 baud on all 80386 and
  173.                               up machines.
  174.  
  175.                   SUPPORT   - If  you  get  stuck,   you will talk to the programmer that
  176.                               wrote the code, not a person hired to answer the phone.
  177.  
  178.                       BBS  -  A user support BBS is available (2400 to 9600 baud, N81) in
  179.                               order to provide immediate support as necessary.
  180.  
  181.                NEWSLETTER  -  One year  subscription  to  the  MSC  newsletter discussing
  182.                               communications problems and solutions (published quarterly).
  183.  
  184.                     PRICE  -  You get PCL4W for a very reasonable price !
  185.  
  186.                  UPGRADES  -  Once  you  buy  PCL4W, you can always update to the most recent
  187.                               version for a very reasonable cost.
  188.  
  189.                COMPATIBLE  -  PCL4W  is  call  for call compatible with the MSDOS based
  190.                               version PCL4C except for two functions in which delay  times
  191.                               are no longer necessary.
  192.  
  193.  
  194.               Our goal is to provide a robust serial communications library that that  you
  195.               and your customers can depend upon.
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.              PCL4W Users Manual                                                Page 3
  205.               1.1 User Support
  206.  
  207.  
  208.               We want you to be successful in developing your applications using PCL4W! We
  209.               depend on our customers to let us know what they need  in  a  communications
  210.               library.   This  means we are committed to providing the best communications
  211.               library that we can. If you have any suggestions or comments, please let  us
  212.               know.
  213.  
  214.               If you are having a problem using PCL4W, call us at 205-881-4630 between 1PM
  215.               and  9PM CST Monday, Wednesday, and Friday; 5PM to 9PM Tuesday and Thursday;
  216.               1PM to 5PM Saturdays, or FAX us at the same telephone number at any time (24
  217.               hours).  You can also call at other times and leave a message, and call back
  218.               later for a reply.  However, we can only answer questions  with  respect  to
  219.               using the PCL4W library.  We cannot help you program your application.
  220.  
  221.               You may also call our User Support BBS (2400 to 9600 baud, no parity, 8 data
  222.               bits,  1  stop  bit)  at 205-880-9748 and leave a message (address it to the
  223.               SYSOP).  We will usually have a reply ready for you within 24 hours.
  224.  
  225.               The BBS  is  available  24  hours  per  day  except  at  2  PM  Sundays  for
  226.               maintenanace. All files are in standard ZIP format. The BBS will contain the
  227.               latest  shareware  version  of  all MarshallSoft products as well as related
  228.               files such as:
  229.  
  230.                    BUGS.ZIP  --  Bug report.
  231.                    NEWS.ZIP  --  Latest news regarding our products.
  232.  
  233.               The MarshallSoft  Computing,  Inc.   newsletter  "Comm  Talk"  is  published
  234.               quarterly.  It discusses various communications problems and solutions using
  235.               PCL4W  as  well  as related information. Registered users receive a one year
  236.               complimentary subscription  when  first  registering  and  for  each  update
  237.               purchased.
  238.  
  239.               Of  course,  you can always write to us. You should receive a reply within a
  240.               week or so. Please don't mail hardware without first talking to us.
  241.  
  242.               We  recommend  the following steps if you believe that you have discovered a
  243.               bug in the library:
  244.  
  245.               (1) Create the smallest, simpliest test program  possible  that  demonstates
  246.               the problem.
  247.  
  248.               (2)  Document  your  exact  machine  configuration  and  what error the test
  249.               program demonstates.
  250.  
  251.               (3) Upload the example source to our user support BBS or mail us a disk.
  252.  
  253.               If  the  problem can be solved with an easy work-around, we will publish the
  254.               work-around.  If the problem requires a modification to the library, we will
  255.               make the change and make the modified library  available  to  our  customers
  256.               without charge.
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.              PCL4W Users Manual                                                Page 4
  273.               1.2 A Typical Application
  274.  
  275.  
  276.               In  general, there are two classes of applications that use a communications
  277.               library like PCL4W -- those that use a modem to connect to the outside world
  278.               and those that connect directly to a peripheral device. In  either  case,  a
  279.               typical   application  program  using  PCL4W  might  consist  of  3  phases:
  280.               initialization, execution, and  termination.   The  following  code  segment
  281.               assumes a knowledge of the windows API.
  282.  
  283.               In  the  following code sgment, SioRxBuf is called to set up the a 1024 byte
  284.               receive buffer; SioParms is called to set up the parity, stop bit count, and
  285.               word length; SioReset is called to set the baud rate to 9600 and  reset  the
  286.               UART (Univeral Asynchronous Receiver / Transmitter).
  287.  
  288.  
  289.                    case WM_CREATE:
  290.                       /* initialization */
  291.                       SioRxBuf(Port,RxBuffer,Size1024);
  292.                       SioParms(Port,NoParity,OneStopBit,WordLength8);
  293.                       SioReset(Port,Baud9600);
  294.  
  295.  
  296.               If you are using the version of  the  library  with  transmitter  interrupts
  297.               enabled  (PCL4W2.LIB),  then  SioTxBuf()  must  be  called  to  set  up  the
  298.               transmitter buffer. The transmit buffer must be distinct  from  the  receive
  299.               buffer.
  300.  
  301.  
  302.                    case WM_CREATE:
  303.                       /* initialization */
  304.                       SioRxBuf(Port,TxBuffer,Size1024);
  305.                       SioTxBuf(Port,RxBuffer,Size1024);
  306.                       SioParms(Port,NoParity,OneStopBit,WordLength8);
  307.                       SioReset(Port,Baud9600);
  308.  
  309.  
  310.               Characters can be  transmitted  and  received  once  the  required  port  is
  311.               initialized.   Before leaving your application, SioDone is called to restore
  312.               the prior state of the serial communications  system.   Forgetting  to  call
  313.               SioDone  before  exiting your application will leave the interrupt system in
  314.               an unusable state and the machine will have to be re-booted.
  315.  
  316.  
  317.                    case WM_DESTROY:
  318.                       /* termination */
  319.                       SioDone(Port);
  320.  
  321.  
  322.               If  you  are using a modem, you also need to be concerned about initializing
  323.               your modem correctly and handling any required flow control.  Refer  to  the
  324.               "Talking to Your Modem" chapter for detailed information.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.              PCL4W Users Manual                                                Page 5
  341.               1.3 Installation
  342.  
  343.  
  344.               (1) Before installation of PCL4W , your Windows C compiler should already be
  345.               installed on your system and tested. If you are not familiar with makefiles,
  346.               refer  to  your compiler manual.  Examine the file "FILES.LST" for a list of
  347.               the distribution files.
  348.  
  349.               (2) Make a backup  copy  of  your  distribution  disk.   Put  your  original
  350.               distribution disk in a safe place.
  351.  
  352.               (3)  Create a work directory on your work disk (normally your harddisk). For
  353.               example, to create a work directory named PCL4W, we first log onto the  work
  354.               disk and then type:
  355.  
  356.                                MKDIR PCL4W
  357.  
  358.               (4)  Copy  all  the  files from your backup copy of the distribution disk to
  359.               your work directory.  For example, to copy from the A: drive  to  your  work
  360.               directory, we type:
  361.  
  362.                               CD PCL4W
  363.                               COPY A:*.*
  364.  
  365.               (5)  Compile SIMPLE.C and link with the PCL4W library (PCL4W.LIB).
  366.  
  367.               Makefiles are provided for each of the  supported  compilers.   If  you  are
  368.               unfamiliar  with  makefiles,  please  consult  your  compiler  manual. After
  369.               compiling with the provided  makefiles,  you  can  convert  to  a  Microsoft
  370.               Workbench  or Borland Integrated Development Environment project file if you
  371.               wish. Compile as follows (use NMAKE not MAKE in (a) below):
  372.  
  373.                       (a) Microsoft C: Type  NMAKE SIMPLE._M_
  374.  
  375.                       (b) Borland C: Type  MAKE -fSIMPLE._B_
  376.  
  377.               SIMPLE.C  should  compile and link without any problems.
  378.  
  379.               (6) The recommended way to test  SIMPLE  is  to  run  it  on  two  computers
  380.               connected  by  a null modem cable.  Whatever is typed on one computer should
  381.               be displayed on the other. If you don't have  two  computers,  you  can  use
  382.               SIMPLE  to talk to your modem. Sending an "AT" to the modem should result in
  383.               an "OK" being sent back.
  384.  
  385.               (7) If you have downloaded the TERM test program (WTERM10.ZIP), be  sure  to
  386.               create  a  separate  directory  and  copy  all TERM files into it.  The TERM
  387.               program uses some functions of enhanced capability with  the  same  name  as
  388.               used by the SIMPLE program.
  389.  
  390.               Once you have become familiar with the PCL4W files  and  have  compiled  and
  391.               tested SIMPLE, you may want to re-organize your files into sub-directories.
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.              PCL4W Users Manual                                                Page 6
  409.               2.0 Library Organization
  410.  
  411.  
  412.               The  PCL4W  library  is organized into six categories of functions. Refer to
  413.               the PCL Reference Manual (PCL4W.REF) for details on individual functions.
  414.  
  415.  
  416.               2.1 Configuration
  417.  
  418.  
  419.               There are three functions in the configuration category.  SioPorts sets  the
  420.               number  of  PC and DigiBoard ports.  SioUART is used to change the UART base
  421.               address for a communications port to a non-standard address, while SioIRQ is
  422.               used to assign a nonstandard IRQ line to  a  port.   (See  the  chapter  IBM
  423.               Communications  Ports  for  more  details on standard UART addresses and IRQ
  424.               lines).
  425.  
  426.               The  configuration  functions  SioPorts,  SioUART  and SioIRQ must be called
  427.               before calling any other library functions.   Be  very  careful  when  using
  428.               these  functions.   Remember that your serial hardware must support the UART
  429.               and IRQ that you specify.  Always test any new configuration immediately.
  430.  
  431.                    SioPorts -- Sets number of PC and DigiBoard ports.
  432.                    SioUART  -- Sets the UART base address.
  433.                    SioIRQ   -- Assigns an IRQ line to a port.
  434.  
  435.               THE IRQ GOLDEN RULE: You may open (via  SioReset)  only  one  port  per  IRQ
  436.               (except for the DigiBoard).
  437.  
  438.  
  439.               2.2 Initialization & Termination
  440.  
  441.  
  442.               There  are  eight  functions in the initialization and termination category.
  443.               Together, SioParms, SioFIFO, SioRxBuf,  SioTxBuf,  and  SioReset  initialize
  444.               your  serial communications system.  Your application must call SioParms and
  445.               SioRxBuf before calling SioReset, and SioReset must  be  called  before  any
  446.               serial I/O processing can be done.
  447.  
  448.               After initialization, SioParms and SioBaud can be called again to change the
  449.               communications  parameters without resetting the serial port. SioFlow can be
  450.               called to enable hardware flow control.
  451.  
  452.               Before exiting from your application, SioDone must  be  called.  Failure  to
  453.               call SioDone can crash your system later.
  454.  
  455.                    SioRxBuf   -- Sets up receive buffer.
  456.                    SioTxBuf   -- Sets up transmitter buffer.
  457.                    SioFIFO    -- Sets the interrupt level for the INS16550.
  458.                    SioParms   -- Sets parity, stop bits, and word length.
  459.                    SioReset   -- Initialize a serial port for processing.
  460.                    SioDone    -- Terminates further serial processing.
  461.                    SioBaud    -- Sets the baud rate of the selected port.
  462.                    SioFlow    -- Enables / disables flow control.
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.              PCL4W Users Manual                                                Page 7
  477.               2.3 Modem Control & Status
  478.  
  479.  
  480.               There  are  eight  functions  in the modem control and status category which
  481.               provide your application with complete control over the status  and  control
  482.               bits of your modem.
  483.  
  484.               There  are  two modem control bits, "Data Terminal Ready" (DTR) and "Request
  485.               To Send" (RTS). These bits can be  read,  set,  or  cleared  by  SioDTR  and
  486.               SioRTS.
  487.  
  488.               There  are  four  modem status bits, "Data Set Ready" (DSR), "Clear To Send"
  489.               (CTS), "Ring Indicator" (RI), and "Data Carrier Detect" (DCD). SioModem  can
  490.               read  any  of  the modem status bits.  SioDSR, SioCTS, SioRI, and SioDCD can
  491.               only read their respective modem status bit.
  492.  
  493.               Refer to the chapter entitled "RS232 Signals" for a discussion  of  each  of
  494.               the control and status bits.
  495.  
  496.                    SioDTR   -- Set, clear, or read the Data Terminal Ready (DTR) bit.
  497.                    SioRTS   -- Sets, clears, or reads the Request to Send (RTS) line.
  498.                    SioModem -- Reads the modem status register.
  499.                    SioDSR   -- Reads the Data Set Ready (DSR) modem status bit.
  500.                    SioCTS   -- Reads the Clear to Send (CTS) modem status bit.
  501.                    SioDCD   -- Reads the Data Carrier Detect (DCD) modem status bit.
  502.                    SioRI    -- Reads the Ring Indicator (RI) modem status bit.
  503.                    SioRead  -- Reads the contents of the 7 UART registers.
  504.  
  505.  
  506.               2.4 Serial I/O
  507.  
  508.  
  509.               There  are  eight  library  functions  in the serial I/O category. Together,
  510.               these functions give the programmer complete control over serial I/O. Higher
  511.               level functions such as protocols and  smart  modem  communications  can  be
  512.               completely  implemented  in  terms  of these functions. Refer to the example
  513.               code.
  514.  
  515.               SioGetc and SioPutc perform all the actual serial I/O.   SioUnGetc  "ungets"
  516.               the  last  serial  byte  read.  SioRxFlush  clears  the  receive queue while
  517.               SioTxFlush clears the transmit queue. SioLine can be used to test  for  UART
  518.               errors.   SioRxQue  returns  the  number of bytes in the receive queue while
  519.               SioTxQue returns the number of bytes in the transmit queue.
  520.  
  521.                    SioGetc    -- Reads the next character from the serial line.
  522.                    SioPutc    -- Transmit a character over a serial line.
  523.                    SioUnGetc  -- "Un-gets" (puts back) a specified character.
  524.                    SioRxFlush -- Flush (clears) the receive buffer.
  525.                    SioRxQue   -- Returns the number of characters in the RX queue.
  526.                    SioTxFlush -- Flush (clears) the transmit buffer.
  527.                    SioTxQue   -- Returns the number of characters in the TX queue.
  528.                    SioLine    -- Reads the line status register.
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.              PCL4W Users Manual                                                Page 8
  545.               2.5 Error Detection
  546.  
  547.  
  548.               There are two functions in the error detection category. They are  concerned
  549.               with  detecting  or reporting communications errors.  Use of these functions
  550.               can make your application significantly more robust.
  551.  
  552.               SioBrkSig can read or  modify  the  UART  break  bit.  This  is  useful  for
  553.               signalling   the   remote  system  that  a  fatal  condition  has  occurred.
  554.               SioLoopBack can be used to test the integrity of your UART.
  555.  
  556.               There is also a file SIOERROR.C which contains the function  SioError  which
  557.               displays  a  error  message  corresponding  to an error code returned from a
  558.               PCL4W function (every PCL4W function returns a code).
  559.  
  560.                    SioBrkSig   -- Asserts, cancels, or detects the RS232 BREAK  signal.
  561.                    SioError    -- Displays  error  in  text.
  562.                    SioLoopBack -- Performs a UART loopback test.
  563.  
  564.  
  565.               2.6 General Support
  566.  
  567.  
  568.               There is one function in the general support category. SioInfo  returns  the
  569.               version  number  of  the  library  and  whether  transmitter  interrupts are
  570.               enabled.
  571.  
  572.                    SioInfo     -- Returns the library version & memory model.
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.              PCL4W Users Manual                                                Page 9
  613.               3.0 Library Overview
  614.  
  615.  
  616.               3.1 Dynamic Link Libraries
  617.  
  618.  
  619.               PCL4W is provided as a dynamic link library (DLL). A DLL is characterized by
  620.               the fact that it need not be loaded until required by an application program
  621.               and that only one copy of the DLL is necessary regardless of the  number  of
  622.               application  programs  that  use it. Contrast this to the traditional static
  623.               library which is bound to each and every application that uses  it  at  link
  624.               time.
  625.  
  626.               Since  PCL4W is a DLL, only one copy of the PCL4W code & data is loaded into
  627.               memory regardless of the number of applications programs that use it.
  628.  
  629.               For example, more than one instance  of  the  test  program  simple  can  be
  630.               started.   All  copies of SIMPLE can run concurrently as long as each uses a
  631.               different COM port.
  632.  
  633.  
  634.               3.2 DOS Protected Mode Interface
  635.  
  636.  
  637.               Windows itself uses what is known as  the  "DOS  Protected  Mode  Interface"
  638.               (DPMI)  to  control  changing  states  (protected  vs real), controlling the
  639.               interrupt system, etc.  This is necessary because Windows  itself  typically
  640.               runs  in  a  protected  state  and must change to real state in order to use
  641.               MSDOS services.
  642.  
  643.               The  PCL4W  library  uses  this same DPMI mechanism. In particular, the file
  644.               USE_DPMI.ASM contains the necessary functions for using DPMI. The  developer
  645.               should not modify USE_DPMI.ASM in any way.
  646.  
  647.  
  648.               3.3 Memory Models
  649.  
  650.  
  651.               Most windows programs are small or medium memory model programs since  these
  652.               memory  models  are  limited  to  one  data  segmnemt.   However,  all PCL4W
  653.               functions are FAR functions, so they can be  used  with  any  memory  model.
  654.               Thus,  there  is  just  one PCL4W.DLL and PCL4W.LIB regardless of the memory
  655.               model used.
  656.  
  657.  
  658.               3.4 Using the Library
  659.  
  660.  
  661.               The PCL4W has been tested on a TANDY 3000 (80286 IBM AT  clone),  a  Gateway
  662.               2000 25 MHZ 80386-DX, and a Gateway 2000 66MHZ 80486-DX2.
  663.  
  664.               Please examine the PCL4W.H file. Note that COM1 is defined as port zero, not
  665.               port  one.   The  user must assume the responsibilty for passing the correct
  666.               information when calling PCL4W functions.
  667.  
  668.               If there are any conflicts between PCL4W  definitions  and  those  in  other
  669.               libraries,  the PCL4W definitions can be changed in the PCL4W.H file and any
  670.               file that uses the definition. There is no change necessary for the  library
  671.               code itself.
  672.  
  673.               If  you  write  an  application  using  the PCL4W library, don't run another
  674.               application that uses the same communications port.
  675.  
  676.  
  677.  
  678.  
  679.  
  680.              PCL4W Users Manual                                                Page 10
  681.               3.5 Example Programs
  682.  
  683.  
  684.               Two  communications  programs  are  provided as a demonstration of the PCL4W
  685.               library -- SIMPLE and TERM.
  686.  
  687.               SIMPLE  is  provided  as  the  easiest example of communications programming
  688.               using PCL4W.  The user should compile and link SIMPLE.C as  a  test  of  the
  689.               library.
  690.  
  691.               If you have two computers, connect them together with a null modem cable and
  692.               run SIMPLE on both machines.  The baud rate in SIMPLE is hard coded to  2400
  693.               baud. It is easily changed in the source code. Start SIMPLE by typing SIMPLE
  694.               followed by the port.
  695.  
  696.               The  TERM  program  is  a  more  capable  terminal  emulator than SIMPLE. It
  697.               features modem initialization, hardware flow control, and state driven  file
  698.               transfer  using  ASCII,  XMODEM, and YMODEM, communications protocols.  TERM
  699.               can be used to call up any bulletin board system, including the MarshallSoft
  700.               Computing BBS.
  701.  
  702.               Refer to the sections on SIMPLE and TERM in this manual  for  more  detailed
  703.               information.
  704.  
  705.  
  706.               3.6 Making the Library
  707.  
  708.  
  709.               Registered  users  may  wish  to  assemble PCL4W.ASM.  Use the /MX switch in
  710.               order to disable automatic conversion from lower case to upper case.  If the
  711.               /MX switch is not used, then all PCL4W function references in C code must be
  712.               in upper case. To assemble using the Microsoft assembler, use  the  provided
  713.               makefile "PCL4W.MAK". Type
  714.  
  715.                    nmake pcl4w.mak
  716.  
  717.               Two  libraries  are  made, one with transmitter interrupts disabled (PCL4W1)
  718.               and one with transmitter interrupts enabled (PCL4W2). Most users should  use
  719.               the  library  without transmitter interrupts enabled since they require less
  720.               overhead.
  721.  
  722.               To use the PCL4W library without transmitter interrupts enabled, type
  723.  
  724.                    copy pcl4w1.lib pcl4w.lib
  725.                    copy pcl4w1.dll pcl4w.dll
  726.  
  727.               To use the PCL4W library with transmitter interrupts enabled, type
  728.  
  729.                    copy pcl4w2.lib pcl4w.lib
  730.                    copy pcl4w2.dll pcl4w.dll
  731.  
  732.  
  733.               After creating PCL4W.LIB and PCL4W.DLL, the example programs can be compiled
  734.               and linked. Refer to the section "Example Programs".
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.              PCL4W Users Manual                                                Page 11
  749.               4.0 Talking to Your Modem
  750.  
  751.  
  752.               A  modem  is  used  to  extend  the distance over which you may communicate.
  753.               Without a modem, your RS232 cable is limited to a maximum  of  approximately
  754.               50 feet.  But with a modem, you can communicate literally around the world.
  755.  
  756.  
  757.               4.1 Modem Standards
  758.  
  759.  
  760.               Two modems can communicate over a telephone line only if they are both using
  761.               the  same  signaling frequencies and modulation, which are determined by the
  762.               the modem standards used.  Modem standards can be divided into  three  sets:
  763.               (1) speed, (2) data compression used, and (3) error control.
  764.  
  765.               The  Bell  standards  (103  &  212A)  are  those  of  AT&T.   The CCITT (The
  766.               International Consultative Committee for Telephone and Telegraph)  standards
  767.               are designated as "V. ".
  768.  
  769.  
  770.               Speed
  771.  
  772.  
  773.                    Bell 103  --   300 baud
  774.                    Bell 212A --  1200 baud
  775.                    V.21      --   300 baud
  776.                    V.22bis   --  1200 & 2400 baud
  777.                    V.32      --  4800 & 9600 baud
  778.                    V.32bis   --  4800, 7200, 9600, 12000, and 14400 baud
  779.  
  780.  
  781.               Data Compression
  782.  
  783.  
  784.                    MNP 5     --  Microcom Networking Protocol (proprietary).
  785.                    V.42bis   --  International data compression standard.
  786.  
  787.  
  788.               Error Control
  789.  
  790.  
  791.                    MNP 2,3,4 --  Three level error correction (public domain).
  792.                    V.42      --  International error correction standard.
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.              PCL4W Users Manual                                                Page 12
  817.               4.2 Flow Control
  818.  
  819.  
  820.               With  modems  using data compression, the modem to modem connection will run
  821.               at various speeds depending on the quality of  the  line.  The  computer  to
  822.               modem  connection  will be at a fixed baud rate. Therefore, a protocol (flow
  823.               control) is necessary to synchronize the data flow between  and  modems  and
  824.               the   computer  to  modem  connection.   Refer  to  your  modem  manual  for
  825.               information on flow control protocols supported.
  826.  
  827.               Two flow control protocols are used by most all modems  which  require  flow
  828.               control.  Software  flow  control  is called "XON/XOFF" (other software flow
  829.               control character pairs are defined but operate the same  as  XON/XOFF)  and
  830.               hardware  flow  control is called "RTS/CTS".  Most modems which require flow
  831.               control enable hardware flow control by default.
  832.  
  833.               In XON/XOFF (software) flow control, the computer suspends transmitting data
  834.               if it receives a XOFF character (13  hex)  from  the  modem,  and  continues
  835.               transmitting  when  it  receives  a XON character (11 hex).  Similiarly, the
  836.               computer can signal the modem not to send any more data  by  transmitting  a
  837.               XOFF  to  it,  and  can tell the modem to continue transmission be sending a
  838.               XON.
  839.  
  840.               In RTS/CTS (hardware) flow control, the RTS line is used by the computer  to
  841.               signal  the  modem  ,  while the CTS line is used by the modem to signal the
  842.               computer.  The RTS line is set OFF by the computer  to  tell  the  modem  to
  843.               suspend  transmission,  and  set  to  ON  to  tell  the  modem  to  continue
  844.               transmission.  The CTS line is set to OFF by the modem to tell the  computer
  845.               to  stop  transmitting,  and  set  to  ON  to  tell the computer to continue
  846.               transmitting.
  847.  
  848.               Given the choice, always choose hardware flow  control  over  software  flow
  849.               control  so  that  all  data  transmission is transparent.  If hardware flow
  850.               control is not the default (which it almost always is),  you  should  modify
  851.               your modem initialization string to turn hardware flow control on.
  852.  
  853.               Both  software  and  hardware flow control is easy to implement using PCL4W.
  854.               See TERM_IO.C for an example of hardware flow control.
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.              PCL4W Users Manual                                                Page 13
  885.               4.3 Modem Initialization
  886.  
  887.  
  888.               If your application uses a modem (as opposed to using a null  modem  cable),
  889.               then  you should always send an initialization string to your modem if it is
  890.               a programmable modem such as those made by  Hayes.   Communication  programs
  891.               such as PROCOMM and TELIX always send such a string automatically as soon as
  892.               they start up.
  893.  
  894.               The particular initialization string depends on the make of your modem.  For
  895.               Hayes  and  Hayes  AT  command  set  compatible modems, the following string
  896.               (followed by a carriage return) should work:
  897.  
  898.                    AT E1 S7=60 S11=60 V1 X1 Q0 S0=0
  899.  
  900.               Refer to your Modem User's Guide for a full discussion of these commands.  A
  901.               brief description is as follows:
  902.  
  903.                    AT     Modem attention command.
  904.                    E1     Modem will echo what you send to it.
  905.                    S7=60  Wait 60 seconds for carrier and/or dial tone.
  906.                    S11=60 Use 60 milliseconds for tone dialing duration & spacing.
  907.                    V1     Display result code as words (not numbers).
  908.                    X1     Use the extended result message (CONNECT XXXX) set.
  909.                    Q0     Modem returns result codes.
  910.                    S0=0   Do not answer RING.
  911.  
  912.               If  your application will answer incoming calls, then set the S0 register to
  913.               the ring on which to automatically answer.
  914.  
  915.               If you send the above codes by using SioPutc (as opposed to typing them from
  916.               the keyboard), then follow these guidelines:
  917.  
  918.               (1) Send an initial carriage return before the initialization string.
  919.  
  920.               (2) Pause at least 150 milliseconds after each character sent as your  modem
  921.               needs the time to perform its own internal processing. Pause a little longer
  922.               if your modem is not accepting your initialization string.
  923.  
  924.               (3)  Pause  one  and a half seconds after sending any initialization command
  925.               such as ATZ or AT&F since your modem must do quite a bit of processing.
  926.  
  927.               If you experience any problems in initializing your Hayes modem, you  should
  928.               first reset it to factory settings by sending:
  929.  
  930.                    AT&F
  931.  
  932.               Refer to the TERM program (function SendToModem in the file MODEM_IO.C)  for
  933.               an example of sending an initialization string to a Hayes compatible modem.
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.              PCL4W Users Manual                                                Page 14
  953.               5.0 Problems
  954.  
  955.  
  956.               If  you  cannot  get your application to run properly, first compile and run
  957.               the terminal emulator program SIMPLE provided  on  your  distribution  disk.
  958.               Test  SIMPLE  by  connecting  two  computers  with  a null modem cable or by
  959.               commanding a Hayes AT command set compatible modem.
  960.  
  961.               Once SIMPLE runs, compile and run the TERM program.  If you are using a null
  962.               modem  cable  or a non-programmable modem, be sure to set the HAYES constant
  963.               to 0 in the source code (#define AT_COMMAND_SET 0). If you are using a Hayes
  964.               compatible modem, set the AT_COMMAND_SET constant to 1.  If you are using  a
  965.               programmable  modem  which is not Hayes compatible, then you must modify the
  966.               initialization string for your particular modem.
  967.  
  968.               If your application does not run but TERM runs correctly, then you have most
  969.               likely  made  a  programming  mistake  in  your  application.   MarshallSoft
  970.               Computing  cannot  debug  your  application,  especially over the telephone!
  971.               However, consider each of the following when searching for an error in  your
  972.               application.
  973.  
  974.               1.  Have you included the file PCL4W.H in your application ?
  975.  
  976.               2.  Is your receive buffer large enough ? If you are using 1K data blocks in
  977.               YMODEM,  then  your  receive  buffer should be at least 1K (2K if baud rates
  978.               above 19200 are to be used).
  979.  
  980.               3.  Have you selected too high a baud rate? Windows can multitask many tasks
  981.               at once. You may have to lower your baud rate (or get 16550 UARTS).
  982.  
  983.               4.  If you are running two COM ports simultaneously, are you using separate
  984.               receive and transmits buffers ? (you should).
  985.  
  986.               5.  Did SioReset return a zero value ?  If not, then you must call  SioReset
  987.               again. See TERM.C for an example.
  988.  
  989.               6.   Did  you  send the proper initialization string to your modem ? Did you
  990.               set DTR and RTS ? (you should).
  991.  
  992.               7.  Do you have more than one COM1 port?  For example, if you  have  a  COM1
  993.               port  on  your  motherboard, you cannot add another COM1 port or modem board
  994.               that uses COM1 without first disabling the COM1 on the motherboard.
  995.  
  996.               8.   Is  your  IRQ set correctly? If you can transmit data but can't receive
  997.               using the PCL4W library with transmitter interrupts disabled (PCL4W2),  then
  998.               this usually means that interrupts are not working.
  999.  
  1000.               Give us a call if you have trouble getting SIMPLE or TERM to work correctly.
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.              PCL4W Users Manual                                                Page 15
  1021.               6.0 Serial Communications
  1022.  
  1023.               6.1 Communications Basics
  1024.  
  1025.  
  1026.               The  heart  of  serial  communications  is  the UART (Universal Asynchronous
  1027.               Receiver Transmitter).  The IBM  PC/XT/AT  and  compatibles  use  the  8250,
  1028.               16450, or the 16550 UART.  The purpose of the UART is:
  1029.  
  1030.               (1) To convert bytes from the CPU (Central Processing Unit), into  a  serial
  1031.               format  by  adding  the  necessary start, stop, and parity bits to each byte
  1032.               before transmission, and to then transmit each bit at the correct baud rate.
  1033.  
  1034.               (2) To convert the incoming stream (at a specified baud rate) of serial bits
  1035.               into bytes by removing the start, stop, and parity bits  before  being  made
  1036.               available to the CPU.
  1037.  
  1038.               The  UART  is part of the serial interface circuitry which allows the CPU to
  1039.               send and receive signals over the RS232 lines. This  can  be  diagrammed  as
  1040.               follows:
  1041.  
  1042.  
  1043.  
  1044.                                     Serial Interface
  1045.                                  *********************
  1046.                                  *                   *
  1047.               *******  Data Bus  *     ********      *    RS232 Signals
  1048.               * CPU **************     * UART *      ******************
  1049.               *******            *     ********      *
  1050.                                  *                   *
  1051.                                  *********************
  1052.  
  1053.  
  1054.  
  1055.               The  8250/16450/16550  UART  is  capable  of  operating in one of two modes,
  1056.               "polled" and "interrupt driven".  The serial communications functions in the
  1057.               BIOS uses the polled method.  In this approach, the CPU is  typically  in  a
  1058.               loop  asking  the  UART  over  and over again if it has a byte ready. If its
  1059.               does, the polling code returns the byte.  But, if the  next  byte  comes  in
  1060.               before the polling code is executing again, then that byte is lost.
  1061.  
  1062.               In the interrupt driven approach (used by PCL4W), when a byte is received by
  1063.               the  UART,  an  "Interrupt  Service  Routine" (ISR) is executed immediately,
  1064.               suspending temporarily whatever else is executing. The ISR  then  moves  the
  1065.               byte to a buffer so that your application program can later read it.
  1066.  
  1067.               If transmitter interrupts are enabled, then  bytes  are  queued  up  waiting
  1068.               transmission.   When  a  byte  is  moved  from  the UART transmitter holding
  1069.               register to the UART transmitter shift register, an interrupt  is  generated
  1070.               and  the  next  byte is taken from the library transmitter buffer by the ISR
  1071.               and written to the UART holding register.
  1072.  
  1073.               Up to 16 bytes can be taken from the transmitter buffer while processing one
  1074.               transmitter  interrupt  if an 16550 UART is used. The 16550 UART is strongly
  1075.               recommended for computers doing serial communications under Windows.
  1076.  
  1077.               Refer to the sections entitled "RS232 Signals" and "National  INS8250  UART"
  1078.               for further information on these topics.
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.              PCL4W Users Manual                                                Page 16
  1089.               6.2 Standard Port Addresses
  1090.  
  1091.  
  1092.               There  are  a  few  things to know about how serial communications ports are
  1093.               used by IBM PC/XT/AT and compatible computers.  The  standard  IBM  PC/XT/AT
  1094.               configuration values are as follows:
  1095.  
  1096.                     Port     Reg Base   IRQ Line   Vector
  1097.                     COM1        3F8H         4        12
  1098.                     COM2        2F8H         3        11
  1099.                     COM3        3E8H         4        12
  1100.                     COM4        2E8H         3        11
  1101.  
  1102.               (Refer to your DigiBoard manual for DigiBoard addresses).
  1103.  
  1104.               PCL4W  assumes the above values.  If necessary, the UART base address can be
  1105.               changed by SioUART, and IRQ lines can be re-assigned  by  SioIRQ.   Remember
  1106.               that  each  port to be used concurrently must have a unique IRQ line.  Refer
  1107.               to the PCL4W Reference Manual for specific details.
  1108.  
  1109.               When installing new  communications  cards,  the  following  guidelines  are
  1110.               recommended:
  1111.  
  1112.               (1)  Be  sure to read the documentation for the hardware you are installing.
  1113.               Pay special attention to UART base addresses and IRQ lines, particularly  if
  1114.               trying to set up a non-standard configuration.
  1115.  
  1116.               (2)  If  you  have  a  choice in base addresses and IRQ lines, always choose
  1117.               standard values as defined above.
  1118.  
  1119.               (3) The first port should be COM1, the second COM2, etc.
  1120.  
  1121.               (4)  Use SioUART to zero all unused ports (for example, call SioUART(COM4,0)
  1122.               if there is no COM4 port installed).
  1123.  
  1124.               (5) Be carefull not to configure two ports for the  same  address.  This  is
  1125.               easier to do than you may believe.
  1126.  
  1127.               (6)  Choose  an  external  modem over an internal one.  It is much easier to
  1128.               debug problems with an external modem than an internal one.
  1129.  
  1130.               (7) Select hardware flow control (RTS/CTS) if flow control is  required  and
  1131.               hardware flow control is not the default.
  1132.  
  1133.               (8)  Always  test your port as soon as it is installed. Try several programs
  1134.               that use the communications ports.
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.              PCL4W Users Manual                                                Page 17
  1157.               6.3 Running 3 or 4 Ports Concurrently
  1158.  
  1159.  
  1160.               PCL4W supports up to 4 serial ports running concurrently (more if you have a
  1161.               DigiBoard).  One free interrupt for each port is required. Refer to the next
  1162.               section if you have a DigiBoard.
  1163.  
  1164.               Interrupts IRQ4 and IRQ3 are dedicated to  the  communications  ports  in  a
  1165.               standard  IBM  PC/XT/AT configuration.  IRQ4 is shared between COM1 and COM3
  1166.               while IRQ3 is shared between COM2 and COM4.  This means that you can run two
  1167.               ports simultaneously provided that they don't share an interrupt.
  1168.  
  1169.               Suppose that you wish to run 3 ports simultaneously. To begin, you must have
  1170.               3 serial UARTs installed on your computer.  Assume,  for  purposes  of  this
  1171.               discussion,  that  COM1  is installed on your motherboard, and that you have
  1172.               purchased a new 2 port serial communications board.
  1173.  
  1174.               You should be able to configure the first serial board port as  COM2,  which
  1175.               uses IRQ3.  Refer to the manual that came with your serial board.
  1176.  
  1177.               In  order  to  run the third serial port concurrently with the first two, an
  1178.               unused interrupt must be found.  If your serial card can use only  IRQ3  and
  1179.               IRQ4,  then there is no way to run a third line since IRQ4 and IRQ3 are used
  1180.               for COM1 and COM2.
  1181.  
  1182.               However, many serial cards can use other IRQs, typically IRQ2 through  IRQ7.
  1183.               Since  IRQ5  is  normally  used  for  a  second  printer  port, it is a good
  1184.               candidate for COM3. To use IRQ5 for the third serial port,  first  set  your
  1185.               serial card to use IRQ5 for COM3 (refer to your serial card manual) and then
  1186.               add the following line to your applications code before calling SioReset:
  1187.  
  1188.                    SioIRQ(COM3,IRQ5);
  1189.  
  1190.               Don't  forget  to  disable  any device that might use IRQ5, such as a second
  1191.               printer port or a music card.   Unfortunately,  there  is  no  easy  way  to
  1192.               determine  that  you have no conflicts until you actually attempt to use the
  1193.               IRQ. If there are conflicts, your system will probably  hang  and  you  will
  1194.               have to reboot.
  1195.  
  1196.               To  run  a  fourth  serial  port,  another  free IRQ must be found.  On some
  1197.               systems, IRQ7 can be used. You must first disable IRQ7 on your parallel port
  1198.               card first (your printer doesn't need an IRQ). To use IRQ7  for  the  fourth
  1199.               serial port, first set your serial card to use IRQ7 for COM4 and then add:
  1200.  
  1201.                    SioIRQ(COM4,IRQ7);
  1202.  
  1203.               To  summarize,  your  serial  card must be able to generate the correct IRQ,
  1204.               which is not already being used. Refer to the entry for the SioIRQ  function
  1205.               in the PCL4W Reference Manual.
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.              PCL4W Users Manual                                                Page 18
  1225.               6.4 Using the DigiBoard
  1226.  
  1227.  
  1228.               The Personal Communications Library supports the DigiBoard  PC/4  and  PC/8,
  1229.               not  the Intelligent Digiboards such as the PC/Xe and PC/Xi. In order to use
  1230.               the DigiBoard, you must configure PCL4W using the SioPorts(), SioUART(), and
  1231.               SioIRQ() functions.
  1232.  
  1233.               Your PCs ports must be partitioned into "standard" PC  ports  and  DigiBoard
  1234.               ports.  Remember that standard PC ports cannot share IRQs like the DigiBoard
  1235.               can.  If  you  are  using IRQ4 and IRQ3 for standard PC ports COM1 and COM2,
  1236.               then you cannot use either for DigiBoard ports (try IRQ5 or IRQ7).
  1237.  
  1238.               Suppose that COM1 through COM2 are standard PC ports (using IRQ4  and  IRQ3)
  1239.               and  you  have  installed  a  PC/8  DigiBoard  that you wish to use for COM3
  1240.               through COM10 using interrupt line IRQ5.  You choose to use the  recommended
  1241.               DigiBoard UART addresses at 0x100, 0x108, 0x110, 0x118, 0x120, 0x128, 0x130,
  1242.               and  0x138.   Add  the  following  configuration statements before doing any
  1243.               other serial processing:
  1244.  
  1245.               SioPorts(10,COM3,0x140); /* COM3  is  first  DigiBoard  port  */
  1246.  
  1247.               Address = 0x100; /* first DigiBoard UART address */
  1248.  
  1249.               for(Port=COM3;Port<=COM10;Port++) /* look at each port */
  1250.                  {SioUART(Port,Address);        /* set the UART  address  */
  1251.                   Address  +=  8;               /* compute  next  address */
  1252.                   SioIRQ(Port,IRQ5);            /* set the DigiBoard IRQ */
  1253.                  }
  1254.  
  1255.               The DigiBoard uses 0x140 for the status address for odd interrupts and 0x141
  1256.               for even interrupts.  Thus 0x140 is used for the status address  since  IRQ5
  1257.               is used for the interrupt in the example above.
  1258.  
  1259.               Don't  forget  that  your DigiBoard hardware must be configured to match the
  1260.               IRQ and UART values that you specify in the library. Refer to your DigiBoard
  1261.               manuals for more information.
  1262.  
  1263.               The PCL4W library comes configured for 4 PC ports and no DigiBoard ports  --
  1264.               SioPorts(4,4).   Refer  to  the  PCL4W  Reference  Manual  for more detailed
  1265.               information on SioPorts(), SioUART(), and SioIRQ().
  1266.  
  1267.               If you are interested in the DigiBoard, they may be contacted at 6400 Flying
  1268.               Cloud  Drive,  Eden  Prairie,  MN  55344.   Telephone  612-943-9020  or  FAX
  1269.               612-943-5398.
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.              PCL4W Users Manual                                                Page 19
  1293.               6.5 Transmitter Interrupts
  1294.  
  1295.  
  1296.               Transmitter interrupts are supported by the library.  Separate libraries are
  1297.               provided, one with transmitter interrupts enabled  and  one  without.   When
  1298.               transmitter  interrupts  are  NOT  enabled, the following logic occurs every
  1299.               time you call SioPutc():
  1300.  
  1301.                1. Wait for transmit buffer to become empty. The transmit  buffer  may  not
  1302.               be empty if the previous transmit is not completed (the UART breaks down the
  1303.               byte  &  sends  1  bit at a time). 2. When the transmit buffer is empty, the
  1304.               byte from the SioPutc() call is loaded into the transmit buffer and  control
  1305.               is returned to the caller.
  1306.  
  1307.               Note that you can not write to the UART any faster the the UART baud rate.
  1308.  
  1309.               When transmitter interrupts are enabled, the byte from SioPutc() is put into
  1310.               a previously prepared (by SioTxQue) transmitter queue. The interrupt service
  1311.               routine  fetches bytes from this queue as soon as the previous byte has been
  1312.               sent.
  1313.  
  1314.               While you can now call SioPutc() faster than the baud rate, bytes are  still
  1315.               transmitted at the given baud rate.
  1316.  
  1317.               The   above   sounds   like  transmitter  interrupts  are  the  way  to  go.
  1318.               Unfortunately, this is usually NOT the case.  Most applications will perform
  1319.               better if transmitter interrupts are NOT enabled.
  1320.  
  1321.               The reason is that transmitter interrupts double the amount of code  in  the
  1322.               time  critical interrupt service routine.  While the library is processing a
  1323.               transmitter interrupt (which can take a while), incoming bytes  can  not  be
  1324.               processed.  What this means is that a given machine can run at a higher baud
  1325.               rate without transmitter interrupts. This problem is compounded when running
  1326.               multiple ports simultaniously.
  1327.  
  1328.               However,  there are a few application areas where transmitter interrupts are
  1329.               preferable.  If your application will be  transmitting  blocks  of  data  at
  1330.               fairly slow baud rates you might profit from enabling transmitter interrupts
  1331.               provided  that there is something else for the processor to do (which is NOT
  1332.               the case in most protocols).
  1333.  
  1334.               However,  if  you are using 16550 UARTS (which have 16 byte on-chip transmit
  1335.               and receive buffers rather that the 1 byte buffers on  the  8250  and  16450
  1336.               UARTS),  you  may  want  to  use the library version with interrupts enabled
  1337.               provided that you enable the 16550 UART with the SioFIFO() function.
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.              PCL4W Users Manual                                                Page 20
  1361.               6.6 RS-232 Signals
  1362.  
  1363.  
  1364.               RS-232 is the name of the serial data interface  standard  used  to  connect
  1365.               computers  to modems.  Most IBM compatible computers are built with at least
  1366.               one serial port and use either DB9 (9 pin) or DB25 (25 pin) connectors.
  1367.  
  1368.               A summary of these pins and  their  function  follows.   For  more  detailed
  1369.               information, refer to one of the many books dealing with RS-232 interfacing.
  1370.  
  1371.               Signal Ground Pin 7 (DB25), Pin 5 (DB9)
  1372.  
  1373.               The  SG  line  is  used  as  the  common  signal  ground, and must always be
  1374.               connected.
  1375.  
  1376.               Transmit Data Pin 2 (DB25), Pin 3 (DB9)
  1377.  
  1378.               The TX line is used to carry data from the computer to the modem.
  1379.  
  1380.               Receive Data Pin 3 (DB25), Pin 2 (DB9)
  1381.  
  1382.               The RX line is used to carry data from the modem to the computer.
  1383.  
  1384.               Data Terminal Ready Pin 20 (DB25), Pin 4 (DB9)
  1385.  
  1386.               The DTR line is used by the computer to signal the modem that it  is  ready.
  1387.               DTR should be set high when talking to a modem.
  1388.  
  1389.               Data Set Ready Pin 6 (DB25), Pin 6 (DB9)
  1390.  
  1391.               The DSR line is used by the modem to signal the computer that it is ready.
  1392.  
  1393.               Request to Send Pin 4 (DB25), Pin 7 (DB9)
  1394.  
  1395.               The  RTS  line  is used to "turn the line around" in half duplex modems, and
  1396.               for hardware flow control in most modems that require flow control.
  1397.  
  1398.               Clear to Send Pin 5 (DB25), Pin 8 (DB9)
  1399.  
  1400.               The CTS line is used to "turn the line around" in half  duplex  modems,  and
  1401.               for hardware flow control in most modems that require flow control.
  1402.  
  1403.               Data Carrier Detect Pin 8 (DB25), Pin 1 (DB9)
  1404.  
  1405.               The DCD line is used by the modem to signal the computer that a data carrier
  1406.               signal is present.
  1407.  
  1408.               Ring Indicator Pin 22 (DB25), Pin 9 (DB9)
  1409.  
  1410.               The RI line is asserted when a 'ring' occurs.
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.              PCL4W Users Manual                                                Page 21
  1429.               6.7 National INS8250, INS16450, and INS16550 UARTs
  1430.  
  1431.  
  1432.               The  Personal  Communications  Library  is  based  on  the standard National
  1433.               INS8250, INS16450, and INS16550 UARTs. The 8250 was the original  UART  used
  1434.               in  the IBM PC, whereas the 16450 is a faster version found on most 286 & up
  1435.               machines. The 16550 contains a 16 byte FIFO to further reduce communications
  1436.               overhead. These UARTs consists of 8 register ports as follows:
  1437.  
  1438.               Offset R/W Register
  1439.                  0   R/W    Receiver  (read)  /  Transmitter  (write)
  1440.                  1   R/W    Interrupt Enable (read)
  1441.                  2   R      Interrupt Identification
  1442.                  2   W      FIFO control (INS16550 only)
  1443.                  3   R/W    Data Format (Line Control)
  1444.                  4   R/W    RS-232 (Modem) Control
  1445.                  5   R/W    Line Status
  1446.                  6   R/W    RS-232 (Modem) Status
  1447.                  7   R/W    Not used.
  1448.  
  1449.               For  the  standard  PC  ports  (not DigiBoard ports), the UART registers are
  1450.               based at 3F8h (COM1), 2F8h (COM2), 3E8h (COM3), and 2E8h (COM4).   COM1  and
  1451.               COM3  share  interrupt  request  line IRQ4 while COM2 and COM4 share request
  1452.               line IRQ3.  This means that  COM1  and  COM3  can't  be  used  concurrently.
  1453.               Similarly for COM2 and COM4.
  1454.  
  1455.               However,  standard PC ports may be re-configured to use other UART addresses
  1456.               and IRQ assignments.  Refer  to  the  SioPorts(),  SioUART(),  and  SioIRQ()
  1457.               functions.
  1458.  
  1459.               If  you  have  a  DigiBoard PC/4 (or PC/8) installed, you will have 4 (or 8)
  1460.               additional ports using INS16450 or INS16550 UARTS.   The  default  DigiBoard
  1461.               ports  are  located  at 100h, 108h, 110h & 118h for the PC/4 continuing with
  1462.               120h 128h, 130h & 138h for the PC/8. IRQ3 is the default for all ports.
  1463.  
  1464.               Four sources of interrupts  are  possible  with  the  8250  and  16550:  (1)
  1465.               receiver error or BREAK, (2) receiver data ready, (3) ready to transmit, and
  1466.               (4)  RS232  input.   These  four  sources  of  interrupts  are summarized as
  1467.               follows:
  1468.  
  1469.                    Source of Interrupt        Action Required to Clear
  1470.                    Receiver error or BREAK.   Read Line Status register.
  1471.                    Receiver data.             Read data from data register.
  1472.                    Transmitter Buffer Empty.  Write to data register or read IID reg.
  1473.                    RS232 Input.               Read Modem Status register.
  1474.  
  1475.               If  you are not familiar with UARTS, several good books are available. Refer
  1476.               to the  Serial  Communications  chapter  for  recommendations.   Although  a
  1477.               knowledge  of  the 8250/16450/16550 is not necessary to use PCL4W, a general
  1478.               knowledge of the theory of asynchronous serial communications is helpfull.
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.              PCL4W Users Manual                                                Page 22
  1497.               6.8 Register Summary
  1498.  
  1499.  
  1500.               REG 0 : Data Register
  1501.  
  1502.               Reading from the data register fetches the  next  input  byte,  once  it  is
  1503.               ready.   Writing  to the data register transmits the byte written to it over
  1504.               the serial line.
  1505.  
  1506.               REG 1 : Interrupt Enable 
  1507.  
  1508.               The Interrupt Enable register enables each of four types of interrupts  when
  1509.               the appropriate bit is set to a one.
  1510.  
  1511.                    bit 3 :  Enable  interrupt  on  RS232  input.
  1512.                    bit 2 :  Enable interrupt on receiver error or break.
  1513.                    bit 1 :  Enable interrupt on transmitter buffer empty (TBE).
  1514.                    bit 0 :  Enable interrupt on received data (RxRDY).
  1515.  
  1516.               REG 2 : Interrupt Identification (IID)
  1517.  
  1518.               Reading the Interrupt Identification (read only) register once an  interrupt
  1519.               has occurred identifies the interrupt as follows:
  1520.  
  1521.                    Bit 2  Bit 1  Bit 0  Priority   Interrupt
  1522.                      0     0      1      none      none
  1523.                      1     1      0      0         (high) Serialization or break.
  1524.                      1     0      0      1         Received data.
  1525.                      0     1      0      2         Transmitter Buffer Empty.
  1526.                      0     0      0      3         (low) RS232 Input.
  1527.  
  1528.               In  the  INS16650,  REG  2  (write  only) is also the FIFO control register.
  1529.               Writing bits 6 & 7 will set the FIFO trigger level (number of bytes received
  1530.               before an interrupt is generated).
  1531.  
  1532.                     Bit 7  Bit 6   Trigger             Bit 7  Bit 6   Trigger
  1533.                       0      0      1 byte               1      0     8 bytes
  1534.                       0      1      4 bytes              1      1     14 bytes
  1535.  
  1536.               REG 3 : Line Control
  1537.  
  1538.               RS232 line parameters are selected by writing to this register.
  1539.  
  1540.                    bit 7   : DLAB = 0
  1541.                    bit 6   : BREAK on(1), off(0).
  1542.                    bits 5-3: Parity None(000),ODD(001),EVEN(011),MARK(101),SPACE(111)
  1543.                    bit 2   : One stop bit(0), two stop bits(1).
  1544.                    bits 1-0: Data bits = 5 (00), 6(01), 7(10), 8(11).
  1545.  
  1546.               When  the Divisor Latch Access Bit (DLAB) is 1, registers 0 and 1 become the
  1547.               LS and MS bytes of the Baud Rate Divisor registers.
  1548.  
  1549.                    Baud   Divisor      Baud  Divisor      Baud  Divisor
  1550.                     300    0180        4800   0018       38400   0003
  1551.                    1200    0060        9600   000C       57600   0002
  1552.                    2400    0030       19200   0006      115200   0001
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.              PCL4W Users Manual                                                Page 23
  1565.               REG 4 : Modem Control
  1566.  
  1567.               RTS, DTR, loopback testing, and  General  Purpose  Outputs  #1  and  #2  are
  1568.               controlled by the Modem Control register as follows:
  1569.  
  1570.                    bit 4 : Enable local loopback.
  1571.                    bit 3 : Enable GP02. Necessary for 8250 interrupts.
  1572.                    bit 2 : Enable GP01.
  1573.                    bit 1 : Set / clear RTS.
  1574.                    bit 0 : Set / clear DTR.
  1575.  
  1576.               REG 5 : Line Status
  1577.  
  1578.               Reading  the  Line Status register provides status information as follows (1
  1579.               for TRUE, 0 for FALSE) :
  1580.  
  1581.                    bit 6 : Transmitter Empty.
  1582.                    bit 5 : Transmitter Buffer Empty (TBE).
  1583.                    bit 4 : BREAK detect.
  1584.                    bit 3 : Framing error.
  1585.                    bit 2 : Parity error.
  1586.                    bit 1 : Overrun error.
  1587.                    bit 0 : Data Ready.
  1588.  
  1589.               REG 6 : Modem Status
  1590.  
  1591.               Reading the Modem Status register provides the following status  information
  1592.               (1 for TRUE, 0 for FALSE) :
  1593.  
  1594.                    bit 7 : DCD status.
  1595.                    bit 6 : RI status.
  1596.                    bit 5 : DSR status.
  1597.                    bit 4 : CTS status.
  1598.                    bit 3 : Delta DCD status.
  1599.                    bit 2 : Delta RI status.
  1600.                    bit 1 : Delta DSR status.
  1601.                    bit 0 : Delta CTS status.
  1602.  
  1603.               The delta bits (bits 0 through 3) are set whenever one of  the  status  bits
  1604.               (bits  4 through 7) changes (from 0 to 1 or from 1 to 0) since the last time
  1605.               the Modem Status register was read. Reading the Modem Status register clears
  1606.               the delta bits.
  1607.  
  1608.               REG 7 : Scratch Register
  1609.  
  1610.               There  is  no  function  associated  with  register 7.  It does not exist in
  1611.               earlier versions of the 8250.
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.              PCL4W Users Manual                                                Page 24
  1633.               7.0 Example Programs
  1634.  
  1635.  
  1636.               There  are  two  example  programs  provided  as described below. A separate
  1637.               directory should be  created  for  each  (and  every)  example  program.  In
  1638.               particular,  the  two example programs described below should be in separate
  1639.               directories.
  1640.  
  1641.               It is recommended that SIMPLE be compiled, linked, and run as a test of  the
  1642.               software installation.
  1643.  
  1644.               In  an  attempt  to  minimize the size of the shareware version of the PCL4W
  1645.               library,  the  TERM  program  files  are  distributed  as  a  separate  file
  1646.               (WTERMxx.ZIP,  where  xx  is the current version). WTERMxx.ZIP can always be
  1647.               downloaded from the MarshallSoft support BBS.
  1648.  
  1649.  
  1650.               7.1 SIMPLE.C
  1651.  
  1652.  
  1653.               SIMPLE is meant as a very  straight  forward,  easy  to  understand  windows
  1654.               communications  program.   Unfortunately,  windows programs are not all that
  1655.               straight forward or easy to understand.
  1656.  
  1657.               SIMPLE is a simple terminal emulator. It reads  from  the  serial  port  and
  1658.               writes  to  the  client  area  and reads from the keyboard and writes to the
  1659.               serial port.  SIMPLE can also talk to a modem, although  you  will  have  to
  1660.               command the modem directly.
  1661.  
  1662.               The  best  way  to  test SIMPLE is to run it on two machines conmnected by a
  1663.               null modem cable. Whatever is typed on one is displayed on  the  other,  and
  1664.               vice  versa.   If you have but one computer, you can use SIMPLE to talk to a
  1665.               modem.
  1666.  
  1667.               To make SIMPLE using the Microsoft SDK, type:
  1668.  
  1669.                    NMAKE SIMPLE._M_
  1670.  
  1671.               To make simple using the Borland compiler, type:
  1672.  
  1673.                    MAKE -fSIMPLE._B_
  1674.  
  1675.               If  you  use a graphical development environment, put the following files in
  1676.               your project file:
  1677.  
  1678.               SIMPLE SIOERROR SIMPL_IO EXPECT CONFIG PAINT LINE ABOUT PCL4W.LIB
  1679.  
  1680.               The SIMPLE makefiles use the small memory model. If a different memory model
  1681.               is  required,  the  Microsoft  (or  Borland)  runtime  library  must also be
  1682.               changed to match the memory model. No  change  is  required  for  the  PCL4W
  1683.               library.
  1684.  
  1685.               For example, to change the makefile from using the  small  memory  model  to
  1686.               using  the  medium  memory  model,  the following changes are necessary: For
  1687.               Microsoft, change -AS to -AM and change SLIBCEW to  MLIBCEW.   For  Borland,
  1688.               change -sm to -mm and change C0WS, CWS, and MATHWS to C0WM, CWM, and MATHWM.
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.              PCL4W Users Manual                                                Page 25
  1701.               7.2 TERM.C
  1702.  
  1703.  
  1704.               TERM is an  communications  program  suitable  for  calling  bulletin  board
  1705.               systems  (BBS)  and performing as a PC to PC file copy program.  TERM itself
  1706.               is not part of the communications library, but rather it is provided  as  an
  1707.               example of a communications application using PCL4W.
  1708.  
  1709.               TERM can send a standard Hayes standard AT command set string to your modem.
  1710.               An  initialization  string  is  sent  by  TERM  provided  that  the constant
  1711.               AT_COMMAND_SET in the file TERM.CFG is defined to be TRUE:
  1712.  
  1713.                    #define AT_COMMAND_SET 1
  1714.  
  1715.               Refer  to  the  chapter  "Modem  Initialization"   for   a   discussion   of
  1716.               initialization strings.
  1717.  
  1718.               TERM also supports hardware flow control (RTS/CTS). Hardware flow control is
  1719.               observed  provided that the constant RTS_CTS_CONTROL in the file TERM.CFG is
  1720.               defined to be TRUE:
  1721.  
  1722.                    #define RTS_CTS_CONTROL 1
  1723.  
  1724.               Refer to the chapter "Flow  Control"  for  a  discussion  of  hardware  flow
  1725.               control.
  1726.  
  1727.               TERM  can  also  exchange  files using ASCII (with XON/XOFF), XMODEM, YMODEM
  1728.               (batch  capability),  and  YMODEM-G  (streaming  YMODEM  used   with   error
  1729.               correcting  modems)  communications protocols.  TERM can accept wildcards in
  1730.               the filename so that multiple files can be sent using YMODEM  and  YMODEM-G.
  1731.               The  protocol  timing can also be adjusted (this should not be necessary) by
  1732.               modifying the constants SHORT_WAIT and LONG_WAIT in the TERM.CFG file.
  1733.  
  1734.               TERM can also be used as a PC to PC transfer  program  using  a  null  modem
  1735.               cable. In this case, AT_COMMAND_SET and RTS_CTS_CONTROL should be defined to
  1736.               be FALSE in the file TERM.CFG:
  1737.  
  1738.                    #define AT_COMMAND_SET  0
  1739.                    #define RTS_CTS_CONTROL 0
  1740.  
  1741.               Be advised that many null modem cables do NOT swap RTS  and  CTS,  which  is
  1742.               necessary  for hardware flow control. This means that RTS_CTS_CONTROL should
  1743.               never be set to 1 (TRUE) when using  a  null  modem  cable  unless  you  are
  1744.               absolutely sure that RTS and CTS are swapped.
  1745.  
  1746.               The  TERM  program  (but  of course not the library itself) is placed in the
  1747.               public domain by MarshallSoft Computing, Inc., and can be used  in  any  way
  1748.               desired by the user.
  1749.  
  1750.               To make TERM using the Microsoft SDK, type:
  1751.  
  1752.                    NMAKE TERM._M_
  1753.  
  1754.               To make simple using the Borland compiler, type:
  1755.  
  1756.                    MAKE -fTERM._B_
  1757.  
  1758.               If  you  use a graphical development environment, put the following files in
  1759.               your project file:
  1760.  
  1761.               TERM INFO SIOERROR TERM_IO XYDRIVER CRC  DIR_IO  EXPECT  CONFIG  PAINT  LINE
  1762.               MODEM_IO ASDRIVER ABOUT MISCELL PCL4W.LIB
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.              PCL4W Users Manual                                                Page 26
  1769.               8.0 Legal Issues
  1770.  
  1771.               8.1 Registration
  1772.  
  1773.  
  1774.               If you wish to register the PCL4W library, please send $95 plus $3  S&H  ($6
  1775.               outside of North America) to:
  1776.  
  1777.                    MarshallSoft Computing, Inc.
  1778.                    Post Office Box  4543
  1779.                    Huntsville AL 35815
  1780.  
  1781.               Multiple copies are available: $65 for 3 to 9, $55 for 10 to 19, and $45 for
  1782.               20  or  more.  A site license is also available for $900 (includes 5 sets of
  1783.               printed documentation). We pay shipping.
  1784.  
  1785.               We accept American Express (account number, expiration date, exact  name  on
  1786.               your card, and complete AmEx billing address required), checks in US dollars
  1787.               drawn  on  a  US  bank, purchase orders (POs) from recognized US schools and
  1788.               companies listed in Dun & Bradstreet, and  COD  (street  address  and  phone
  1789.               number  required)  within  the  USA  (plus a $3 COD charge).  Print the file
  1790.               PCL4W.INV if an invoice is needed.
  1791.  
  1792.               You  can  also  order PCL4W from The Public Software Library (PSL) with your
  1793.               MC, Visa, AmEx, or Discover card by  calling  800-242-4PSL  (from  overseas:
  1794.               713-524-6394)  or  by  FAX  at 713-524-6398 or by CompuServe at [71355,470].
  1795.               THESE NUMBERS ARE FOR ORDERING ONLY. The product number for PCL4W is 11171.
  1796.  
  1797.               If  you  wish to update from an older version of PCL4W, send $20 plus $3 S&H
  1798.               ($6 outside of North  America).   Updates  must  be  ordered  directly  from
  1799.               MarshallSoft Computing.
  1800.  
  1801.               The registered package includes:
  1802.  
  1803.                    o  Libs w/o shareware screens.
  1804.                    o  Assembler source code for the library.
  1805.                    o  Laser printed Users and Reference Manuals.
  1806.                    o  Telephone, FAX, and BBS support for one year.
  1807.  
  1808.               Print the file INVOICE.DOC if an invoice is needed. The registered user will
  1809.               receive the latest version of PCL4W shipped by two day priority mail (packet
  1810.               airmail overseas).  A 5.25" diskette is provided unless a 3.5"  diskette  is
  1811.               requested.
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.              PCL4W Users Manual                                                Page 27
  1837.               8.2 License
  1838.  
  1839.  
  1840.               MarshallSoft  Computing,  Inc. grants the registered user of PCL4W the right
  1841.               to use one copy of the PCL4W library (in object form) on a  single  computer
  1842.               in  the  development  of  any software product (other than libraries such as
  1843.               PCL4W).  The user may not use the library on more than one computer  at  the
  1844.               same  time.   The  source code for the library (PCL4W.ASM) is copyrighted by
  1845.               MarshallSoft Computing and may not be released in whole or in part. Products
  1846.               developed using PCL4W may be distributed without any royalty.
  1847.  
  1848.  
  1849.               8.3 Warranty
  1850.  
  1851.  
  1852.               MARSHALLSOFT COMPUTING, INC.  DISCLAIMS  ALL  WARRANTIES  RELATING  TO  THIS
  1853.               SOFTWARE,  WHETHER  EXPRESSED  OR  IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
  1854.               IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  PURPOSE,
  1855.               AND  ALL  SUCH WARRANTIES ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. NEITHER
  1856.               MARSHALLSOFT COMPUTING, INC. NOR ANYONE ELSE WHO HAS BEEN  INVOLVED  IN  THE
  1857.               CREATION,  PRODUCTION,  OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE FOR ANY
  1858.               INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT  OF  THE  USE  OR
  1859.               INABILITY  TO  USE  SUCH  SOFTWARE EVEN IF MARSHALLSOFT COMPUTING, INC.  HAS
  1860.               BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL
  1861.               MARSHALLSOFT COMPUTING, INC.'S LIABILITY FOR ANY SUCH  DAMAGES  EVER  EXCEED
  1862.               THE  PRICE  PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM
  1863.               OF THE CLAIM. THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY
  1864.               AND PERFORMANCE OF THE SOFTWARE.
  1865.  
  1866.               Some states do not allow  the  exclusion  of  the  limit  of  liability  for
  1867.               consequential  or  incidental damages, so the above limitation may not apply
  1868.               to you.
  1869.  
  1870.               This agreement shall be governed by the laws of the  State  of  Alabama  and
  1871.               shall  inure  to  the  benefit  of  Marshallsoft  Computing,  Inc.   and any
  1872.               successors, administrators, heirs and  assigns.  Any  action  or  proceeding
  1873.               brought  by either party against the other arising out of or related to this
  1874.               agreement shall be brought only in a STATE or  FEDERAL  COURT  of  competent
  1875.               jurisdiction  located in Madison County, Alabama. The parties hereby consent
  1876.               to in personam jurisdiction of said courts.
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.              PCL4W Users Manual                                                Page 28
  1905.               9.0 Summary
  1906.  
  1907.  
  1908.               9.1 Revision History
  1909.  
  1910.  
  1911.               Version 1.0 -- 1 February, 1994.
  1912.  
  1913.               The initial release of PCL4W uses a considerable amount  of  the  code  from
  1914.               version 4.0 of PCL4C (the DOS version of the comm library).
  1915.  
  1916.  
  1917.               9.2 Function Summary
  1918.  
  1919.  
  1920.               Refer  to the PCL4W Reference Manual (PCL4W.REF) for detailed information on
  1921.               the communications and  support  functions.  A  one  line  summary  of  each
  1922.               function follows:
  1923.  
  1924.  
  1925.               ****************************************************************************
  1926.               *  SioBaud     *  Sets the baud rate of the selected port.                 *
  1927.               *  SioBrkSig   *  Asserts, cancels, or detects BREAK signal.               *
  1928.               *  SioCTS      *  Reads the Clear to Send (CTS) modem status bit.          *
  1929.               *  SioDCD      *  Reads the Data Carrier Detect (DCD) modem status bit.    *
  1930.               *  SioDone     *  Terminates further serial processing.                    *
  1931.               *  SioDSR      *  Reads the Data Set Ready (DSR) modem status bit.         *
  1932.               *  SioDTR      *  Set, clear, or read the Data Terminal Ready (DTR) bit.   *
  1933.               *  SioError    *  Displays error in text.                                  *
  1934.               *  SioFIFO     *  Sets the interrupt level for the INS16550.               *
  1935.               *  SioFlow     *  Enables / disables hardware flow control.                *
  1936.               *  SioGetc     *  Reads the next character from the serial line.           *
  1937.               *  SioInfo     *  Returns library version number & memory model.           *
  1938.               *  SioIRQ      *  Assigns an IRQ line to a port.                           *
  1939.               *  SioLine     *  Reads the line status register.                          *
  1940.               *  SioLoopBack *  Performs a UART loopback test.                           *
  1941.               *  SioModem    *  Reads the modem status register.                         *
  1942.               *  SioParms    *  Sets parity, stop bits, and word length.                 *
  1943.               *  SioPorts    *  Sets # ports, 1st DigiBoard port & status register.      *
  1944.               *  SioPutc     *  Transmit a character over a serial line.                 *
  1945.               *  SioRead     *  Reads any of 7 UART ports.                               *
  1946.               *  SioReset    *  Initialize a serial port for processing.                 *
  1947.               *  SioRI       *  Reads the Ring Indicator (RI) modem status bit.          *
  1948.               *  SioRTS      *  Sets, clears, or reads the Request to Send (RTS) line.   *
  1949.               *  SioRxBuf    *  Sets up receive buffer.                                  *
  1950.               *  SioRxFlush  *  Flushes (clears) the receive buffer.                     *
  1951.               *  SioRxQue    *  Returns the number of characters in the receive queue.   *
  1952.               *  SioTxBuf    *  Sets up transmit buffer.                                 *
  1953.               *  SioTxFlush  *  Flushes (clears) the transmit buffer.                    *
  1954.               *  SioTxQue    *  Returns the number of characters in the transmit queue.  *
  1955.               *  SioUART     *  Sets the UART base address.                              *
  1956.               *  SioUnGetc   *  "Un-gets" (puts back) a specified character.             *
  1957.               ****************************************************************************
  1958.  
  1959.               9.3 Further Reading
  1960.  
  1961.  
  1962.               The  best way to learn about serial communications is to read a good book on
  1963.               the subject. Several good texts are available.  Two that I like are:
  1964.  
  1965.               (1) C Programmers's Guide to Serial Communications by  Joe  Campbell  (SAMS)
  1966.               (2) Mastering Serial Communications by Peter Gofton (SYBEX).
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.              PCL4W Users Manual                                                Page 29
  1973.          10.0 Other MarshallSoft Computing Products
  1974.  
  1975.          10.1 The Personal Communications Library for C
  1976.  
  1977.          The  Personal Communications Library for the C Language (PCL4C) is
  1978.          a DOS  based  asynchronous  communications  library  designed  for
  1979.          experienced  software developers programming in C.  Four compilers
  1980.          are supported: Microsoft Optimizing C, Microsoft Quick C,  Borland
  1981.          Turbo  C,  and  MIX  Power  C.   An  IBM PC/XT/AT or compatible is
  1982.          required.  The PCL features:
  1983.  
  1984.          o SMALL, COMPACT, MEDIUM & LARGE memory models.
  1985.          o 36 communications and support functions.
  1986.          o Supports the high performance INS16550 UART.
  1987.          o Supports the Digiboard PC/4 and PC/8.
  1988.          o Supports hardware (RTS/CTS) flow control.
  1989.          o Interrupt driven transmitter (optionally) & receiver.
  1990.          o Supports 300 baud to 115,200 baud.
  1991.          o Supports COM1 through COM4 (through COM10 with Digiboard).
  1992.          o Adjustable receive queues from 8 bytes to 32 KB.
  1993.          o Control-BREAK error exit.
  1994.          o 17 communications error conditions trapped.
  1995.          o Allows 4 ports (10 with DigiBoard) to run concurrently.
  1996.          o Complete modem control & status.
  1997.          o Written in assembly language for small size & high speed.
  1998.          o Terminal program featuring XMODEM, YMODEM, & YMODEM-G.
  1999.  
  2000.          The Personal Communications Library for C (PCL4C) is available for
  2001.          $65  plus  $3 S&H ($6 S&H overseas). It may be ordered at the same
  2002.          time as the Personal Protocol Library for $75 plus $3.50  S&H  ($7
  2003.          overseas).
  2004.  
  2005.          10.2 The LZW Data Compression Library for C
  2006.  
  2007.          LZW4C is  a  DOS  implementation  of  the  LZW  (Lempel-Ziv-Welch)
  2008.          algorithm  for  compressing  and  decompressing  data.   LZW  does
  2009.          particularly well on text files, achieving  better  than  a  50  %
  2010.          compression ratio for many files.
  2011.  
  2012.          The  LZW  algorithm  is  considered  to be one of the best general
  2013.          purpose algorithms available today.  The  new  high  speed  modems
  2014.          that  employ  on-the-fly  data  compression (such as MNP 5.0 & the
  2015.          V.42 bis international standard) use the LZW algorithm, as well as
  2016.          such well known utility programs such as PKZIP.
  2017.  
  2018.          The  LZW  Data Compression Library for C is available for $35 plus
  2019.          $3 S&H ($6 S&H overseas).
  2020.  
  2021.          10.3 The EMS Expanded Memory Library
  2022.  
  2023.          The  DOS  based  EMS4C  library  implements version 3.2 of the LIM
  2024.          (Lotus-Intel-Microsoft) specification for  expanded  memory  .  It
  2025.          will run with either version 3.2 or 4.0 of the LIM specification.
  2026.  
  2027.          The EMM4C library (included with the EMS4C library) is an expanded
  2028.          memory manager which allows C programmers to allocate and free EMS
  2029.          (expanded)  memory similiar to malloc() and free() in the standard
  2030.          C runtime library. Both EMM4C and EMS4C require that  your  system
  2031.          be  configured  with  expanded (EMS) memory. But, 386 & up systems
  2032.          can use extended memory as expanded memory.
  2033.  
  2034.          The EMS Expanded Memory Library for C is available for $35 plus $3
  2035.          S&H ($6 S&H overseas).
  2036.  
  2037.  
  2038.  
  2039.  
  2040.              PCL4W Users Manual                                                Page 30
  2041.